import React from 'react'
import { TreeSelect as AntTreeSelect, TreeSelectProps } from 'antd'
import { CaretDownOutlined } from '@ant-design/icons'
const TreeSelect = (props: TreeSelectProps) => {
  return (
    <AntTreeSelect
      getPopupContainer={triggerNode => triggerNode.parentNode}
      treeCheckable
      treeDefaultExpandAll
      maxTagCount={1}
      allowClear
      showArrow
      dropdownMatchSelectWidth={false}
      placeholder="请选择"
      style={{ width: '100%' }}
      suffixIcon={
        <CaretDownOutlined
          style={{ color: 'var(--xdrsec-switch-background-color)' }}
        />
      }
      {...props}
    />
  )
}
export default TreeSelect
